package edu.ynu.se.xiecheng.achitectureclass.project.po.entity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

import javax.persistence.*;

@Entity
@lombok.Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "Data")//存放大棚获取的具体数值

public class Data {

    @Id
    @Column(name = "serialId", unique = true, nullable = false) // 设备序列号，设置为主键
    private String serialId;
    @Column(name = "boxNo")//大棚编号，第四组300822040454
    private String boxNo;
    @Column(name = "name")//名称
    private String name;
    @Column(name = "value", nullable = false)//传入的值
    private Double value;

    @Column(name = "timestamp", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", updatable = false)
    private LocalDateTime timestamp;
    @Column(insertable = false, nullable = false, columnDefinition = "BOOLEAN DEFAULT FALSE")
    private Boolean isDeleted;

}
